$(document).ready(function () {

    var jianpaiArr = [
        'images/page3_70080.png',
        'images/page3_87600.png',
        'images/page3_109500.png',
        'images/page3_142350.png',
        'images/page3_284700.png'
    ]

    var treeArr = [
        'images/page3_700800ke.png',
        'images/page3_876000ke.png',
        'images/page3_1095000ke.png',
        'images/page3_1423500ke.png',
        'images/page3_2847000ke.png'
    ]

    var selected = 999;

    $(".optionlist .option").on("click", function () {
        $(".optionlist .option").removeClass("checked");
        $(this).toggleClass("checked");
        selected = $(this).data("selected");
        $("#selectaudio")[0].play();
        $("#page3_zhanwei_left").attr("src", jianpaiArr[selected]);
        $("#page3_zhanwei_right").attr("src", treeArr[selected]);
    })

    var swiper1 = new Swiper('.game-container', {
        allowTouchMove: false,
        effect: 'fade',
        speed: 600
    });

    $(".page1_ok").on("click", function () {
        swiper1.slideNext();
    })


    $(".page2_ok").on("click", function () {
        if (selected == 999) {
            alert("还未选择你的厂子的垃圾日处理能力！");
            return false;
        }
        swiper1.slideNext();
        $("#calculatingaudio")[0].play();
        setTimeout(function () {
            swiper1.slideNext();
            $("#calculatingaudio")[0].pause();
        }, 3000)
    })

    $(".page3_ok").on("click", function () {
        swiper1.slideNext();
    })
    $(".page_return").on("click", function () {
        swiper1.slideTo(1);
    })

    $(".game_btn").on("click", function () {
        $("#selectaudio")[0].play();
    })


})